<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="one">hello 1</div>
    <div class="one">hello 2</div>
    <div class="one">hello 3</div>
    <div class="one">hello 4</div>
    <script>
        // 不能对HTML Collection 执行点击事件，只能对具体元素执行事件
        /* 
        this --> 在事件中，谁执行事件，this就指谁
         */
        var all = document.getElementsByClassName("one")
        for(var i=0;i<all.length;i++){
            all[i].onclick=function(){
                // console.log(this)
                this.style.display = "none";
            }
        }
        console.log(all)
    </script>
</body>
</html>